/**
 * 1
 *  
 * @Author : roryrywang
 * @DateTime : 24-8-24 下午1:32
 */

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n;
    long long t;
    cin >> n >> t;
    vector<int> a;
    long long sum = 0;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        a.push_back(x);
        sum += x;
    }

    int res = 0;
    for (int i = 0; i < n; ++i) {
        sum -= 2 * a[i];
        if (sum >= 0 && sum <= t)res++;
        sum += 2 * a[i];
    }

    cout << res;

    return 0;
}